package com.example.demo1.itlianxi08;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * 反射对象.getDeclaredMethods()
 * 反射对象.getDeclaredFields()
 */
public class ReflectDemo1 {
    public static void main(String[] args) throws ClassNotFoundException {
        Class aClass = Class.forName("com.example.demo1.itlianxi07.Student");

        Method[] declaredMethods = aClass.getDeclaredMethods();
        for (Method declaredMethod : declaredMethods){
            System.out.println(declaredMethod);
        }

        System.out.println("==============");
        Field[] declaredClasses = aClass.getDeclaredFields();
        for (Field declaredClass : declaredClasses){
            System.out.println(declaredClass);
        }

    }
}
